<?php echo $this->render('./includes/header.phtml');?>
<?php echo $this->render('./includes/fix_top_menu.phtml');?>
	<div id="container" class="row-fluid">
		<?php echo $this->render('./includes/menu.phtml');?>
		<div id="main-content">
			<div class="container-fluid">
				<div class="row-fluid">
					<div class="span12">
						<h3 class="page-title">
							Quản lí tỉnh/thành phố  <small></small>
						</h3>
					</div>
				</div>
							<div class="row-fluid">
					<div class="span12">
						<div class="widget">
							<div class="widget-title">
								<h4>
									<i class="icon-reorder"></i>Tổng số tỉnh/thành phố : <?php echo $this->total_city;?>
								</h4>
								<div class="pull-right span3">
								<a href="#myModalA"
										role="button" class="btn btn-success span11 pull-right" style="margin-top: 3px; margin-right: 3px;" data-toggle="modal"> <i class="icon-plus icon-white"></i>  Thêm mới tỉnh/thành phố </a>
										<form action="" method="post">
										<div id="myModalA" class="modal hide fade" tabindex="-1"
										role="dialog" aria-labelledby="myModalLabelA"
										aria-hidden="true">
										<div class="modal-header">
											<button type="button" class="close" data-dismiss="modal"
												aria-hidden="true">×</button>
											<h3 id="myModalLabelA">Thêm mới </h3>
										</div>
										<div class="modal-body">
										Tên : <input type="text" name="city_name"/>
										</div>
										<div class="modal-footer">
											
											<button type="submit" class="btn btn-primary" name="btnAdd">Lưu </button>
											<button data-dismiss="modal" class="btn">Đóng </button>
										</div>
									</div>
									</form>
								</div>
							</div>
							<div class="widget-body">
								<?php echo $this->render('./includes/display_alert_message.phtml');?>
								<table class="table table-striped table-bordered" id="sample_1">
									<thead>
										<tr>
											<th>Tên </th>
											<th class="hidden-phone">Ngày tạo </th>
											<th class="hidden-phone">Ngày sửa </th>
											<th class="hidden-phone"></th>
										</tr>
									</thead>
									<tbody>
									<?php 
									if(count($this->arrCity) != 0) {
									foreach ($this->arrCity as $city) {?>
										<tr class="odd gradeX">
											<td><?php echo  $city['name']; ?></td>
											<td class="hidden-phone"><?php echo  $city['created_time']; ?></td>
											<td class="hidden-phone"><?php echo  $city['updated_time']; ?></td>
											<td class="hidden-phone">
												<a href="#myModal<?php echo  $city['city_id']; ?>"
										role="button" class="btn btn-primary" data-toggle="modal"> <i class="icon-pencil"></i> Sửa </a>
										
									<a href="<?php echo $this->baseUrl('/city/?delete=1&city_id='.$city['city_id']);?>" class="btn btn-danger" title="Xoá " onclick="return confirm('Xoá tỉnh/thành phố?');"> <i class="icon-trash"></i> Xoá</a>
					
										<div id="myModal<?php echo  $city['city_id']; ?>" class="modal hide fade" tabindex="-1"
										role="dialog" aria-labelledby="myModalLabel<?php echo  $city['city_id']; ?>"
										aria-hidden="true">
										<form action="" method="post">
										<div class="modal-header">
											<button type="button" class="close" data-dismiss="modal"
												aria-hidden="true">×</button>
											<h3 id="myModalLabel<?php echo  $city['city_id']; ?>"><?php echo  $city['name']; ?></h3>
										</div>
										<div class="modal-body">
										Name : <input type="text" name="city_name" value="<?php echo  $city['name']; ?>"/>
										<input type="hidden" name="city_id" value="<?php echo  $city['city_id']; ?>" />
										</div>
										<div class="modal-footer">
											<button type="submit" class="btn btn-primary" name="btnEdit">Lưu </button>
											<button data-dismiss="modal" class="btn">Đóng </button>
										</div>
										</form>	
									</div>
									
											</td>
										</tr>
										<?php 
										}
										}?>
									</tbody>
								</table>
								<?php if(count($this->arrCity) != 0) {?>
 								<?php echo $this->paginationControl($this->arrCity, 'Sliding' , './includes/pagination.phtml'); ?>
 								<?php }?>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
<?php echo $this->render('./includes/footer.phtml');?>